package com.example.baseadapter;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.SpannableString;
import android.text.style.StyleSpan;
import android.text.style.UnderlineSpan;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class About extends ActionBarActivity {
	TextView email;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//setting action bar background color
	       getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.rgb(10,132,132)));
	       getSupportActionBar().setDisplayHomeAsUpEnabled(true);
	   	getSupportActionBar().setHomeButtonEnabled(true);
		setContentView(R.layout.about);
		email=(TextView)findViewById(R.id.about3);
		String tempString=email.getText().toString();
		SpannableString spanString = new SpannableString(tempString);
		spanString.setSpan(new UnderlineSpan(), 0, spanString.length(), 0);
		spanString.setSpan(new StyleSpan(Typeface.BOLD), 0, spanString.length(), 0);
		spanString.setSpan(new StyleSpan(Typeface.ITALIC), 0, spanString.length(), 0);
		email.setText(spanString);
		email.setOnClickListener(new OnClickListener()
		
		{
			@Override
			public void onClick(View v)
			{  String toEmail="logichat2015@gmail.com";     
				Intent email = new Intent(Intent.ACTION_SEND);
			  email.putExtra(Intent.EXTRA_EMAIL, new String[]{ toEmail});
			//need this to prompts email client only
			  email.setType("message/rfc822");
 
			  startActivity(Intent.createChooser(email, "Choose an Email client :"));
				
			}
		});
	}

}
